/**
 * GoodsDownloadCenter 业务逻辑实现类
 * @author WangXinLei
 * @date 2015-01-28
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.GoodsDownloadCenter;
import com.chnbst.bstyun.service.GoodsDownloadCenterService;

@Transactional
@Service
public class GoodsDownloadCenterServiceImpl extends BaseService implements GoodsDownloadCenterService {
	
	//命名空间
	private final static String nameSpace = "com.chnbst.bstyun.mapper.GoodsDownloadCenterMapper";

	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public GoodsDownloadCenter selectById(String downloadCenterId) {
		return (GoodsDownloadCenter) DaoHelper.query(nameSpace, "selectById", downloadCenterId);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertGoodsDownloadCenter(GoodsDownloadCenter goodsDownloadCenter) {
		return DaoHelper.insert(nameSpace, "insertGoodsDownloadCenter", goodsDownloadCenter);
	}

	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<GoodsDownloadCenter> selectGrid() {
		return (List<GoodsDownloadCenter>) DaoHelper.list(nameSpace, "selectGrid", null);
	}

	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<GoodsDownloadCenter> selectGridByDownloadId(String goodsDownloadId) {
		return (List<GoodsDownloadCenter>) DaoHelper.list(nameSpace, "selectGridByDownloadId", goodsDownloadId);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean deleteById(String downloadCenterId) {
		return DaoHelper.delete(nameSpace, "deleteById", downloadCenterId);
	}
}
